import request from '@/utils/http'
import { PageResult } from '@/api/model/baseModel'
import { ReportPageParam, ReportInfo } from '@/api/model/reportModel'

// 分页获取举报信息列表
export function getReportPageList(params: ReportPageParam) {
  return request.post<PageResult<ReportInfo>>({
    url: '/report/page',
    data: params
  })
}

// 获取举报详情
export function getReportDetail(reportId: number) {
  return request.get<ReportInfo>({
    url: '/report/detail',
    params: { reportId }
  })
}

// 举报审核
export function auditReport(data: {
  reportId: number
  
  auditResult: number
  handleResult: number
  auditRemark: string
}) {
  return request.post({
    url: '/report/audit',
    data: data
  })
}

// 举报处理
export function handleReport(data: {
  reportId: number
  handleResult: number
  handleRemark: string
}) {
  return request.post({
    url: '/report/handle',
    data: data
  })
}

// 获取举报统计数据
export function getReportStats() {
  return request.get<{
    pendingCount: number
    todayCount: number
    totalCount: number
  }>({
    url: '/report/stats'
  })
}
